dcmd_giveweapon(playerid, params[]) { new id, n[MAX_PLAYER_NAME], on[MAX_PLAYER_NAME]; new tmp[256],tmp2[256],tmp3[256], Index, str[49]; tmp = strtok(params, Index), tmp2 = strtok(params,Index), tmp3 = strtok(params,Index), id = strval(tmp), weapon = strval(tmp2), ammo = strval(tmp3); GetPlayerName(id, on, sizeof(on)); GetPlayerName(playerid,n,sizeof(n)); if(PInfo[playerid][Level] < 4) return SendClientMessage(playerid, ORANGE, "You need to be level 4 to use this command!"); if(!strlen(params)) return SendClientMessage(playerid, GREY, "USAGE: /giveweapon <ID> <weaponid> <ammo>"); if(!IsPlayerConnected(id)) return SendClientMessage(playerid, GREY, "Invalid ID"); format(str, sizeof(str), "%s gave weapons to %s", n, on); SendClientMessageToAll(ORANGE, str); GivePlayerWeapon(id, weapon, ammo); return 1; }
error 017: undefined symbol "weapon" error 017: undefined symbol "ammo" error 017: undefined symbol "weapon"
I know what Zcmd is , but im wondering, where is Sscanf used for?
THe download link for Sscanf is not working at the thread ? |
CMD:kick(playerid, params[]) {
new id, reason;
if(sscanf(params, "us[100]", id, reason)) return SendClientMessage(playerid, -1, "USAGE: /kick <playerid/partofname> <reason>");
}
CMD:kick(playerid, params[]) {
new id, reason, name[MAX_PLAYER_NAME];
if(sscanf(params, "us[100]",id, reason)) return SendClientMessage(playerid, -1, "USAGE: /kick <playerid/partofname> <reason>");
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You're not an admin.");
Kick(id);
GetPlayerName(id, name, sizeof(name));
format(string, sizeof(string), "%s has been kicked of the server. Reason: %s", name, reason);
SendClientMessageToAll(-1, string);
return 1;
}
format(string, sizeof(string), "%s has been kicked of the server. Reason: %s", name, reason);
C:\Users\vm07\Desktop\SampServer\filterscripts\gAdmin.pwn(383) : error 017: undefined symbol "string" C:\Users\vm07\Desktop\SampServer\filterscripts\gAdmin.pwn(383) : error 017: undefined symbol "string" C:\Users\vm07\Desktop\SampServer\filterscripts\gAdmin.pwn(383) : error 029: invalid expression, assumed zero
Ooh, wow, thanks for the link and the explanation of it!
Awesome Introzen! |
CMD:me(playerid, params[]) { new string[128],msg[128],pname[MAX_PLAYER_NAME]; GetPlayerName(playerid,pname,sizeof(pname)); if(sscanf(params,"sz",msg)) return SendClientMessage(playerid,ORANGE, "USAGE: /me <text>"); format(string,sizeof(string),"*%s %s",pname,msg); SendClientMessageToAll(GREY,string); return 1; } CMD:kick(playerid, params[]) { new string[128]; new id, reason, name[MAX_PLAYER_NAME]; if(sscanf(params, "us[100]",id, reason)) return SendClientMessage(playerid, -1, "USAGE: /kick <playerid/partofname> <reason>"); if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, -1, "You're not an admin."); Kick(id); GetPlayerName(id, name, sizeof(name)); format(string, sizeof(string), "%s has been kicked of the server. Reason: %s", name, reason); SendClientMessageToAll(-1, string); return 1; }