UID189226
帖子
精華
主題
積分33731
現金
積極性
威望
違規
熱心
推廣次數
閱讀權限30
註冊時間2009-8-20
在線時間 小時
最後登錄1970-1-1
TA的每日心情 | 衰 2022-6-12 07:34 PM |
---|
簽到天數: 260 天 連續簽到: 1 天 [LV.8]以壇為家I
|
發表於 2010-7-22 20:05:14
|
顯示全部樓層
回復 4# Alopex
改成
會變成全部有set的腳本報錯
所以我另外用標籤set2
- BUILDIN_FUNC(set2)
- {
- TBL_PC* sd = NULL;
- struct script_data* data;
- int num;
- const char* name;
- char prefix;
- data = script_getdata(st,2);
- if( !data_isreference(data) )
- {
- ShowError("script:set2: not a variable\n");
- script_reportdata(script_getdata(st,2));
- st->state = END;
- return 1;
- }
- num = reference_getuid(data);
- name = reference_getname(data);
- prefix = *name;
- if( not_server_variable(prefix) )
- {
- if( script_hasdata(st,4) )
- sd=map_id2sd(script_getnum(st,4));
- else
- sd=script_rid2sd(st);
- if( sd == NULL )
- {
- ShowError("script:set2: no player attached for player variable '%s'\n", name);
- return 0;
- }
- }
- if( is_string_variable(name) )
- set_reg(st,sd,num,name,(void*)script_getstr(st,3),script_getref(st,2));
- else
- set_reg(st,sd,num,name,(void*)script_getnum(st,3),script_getref(st,2));
- // return a copy of the variable reference
- script_pushcopy(st,2);
- return 0;
- }
複製代碼
但是使用時變成
是我還有東西沒有改嗎>////<? |
|