Код:
dcmd_giveweapon(playerid,params[]) {
I'm Using ZCMD
Код:
CMD:give weapon(playerid, params[])
i'm tryed add your Script
To my pwno
Код:
dcmd_giveweapon(playerid,params[]) {
if(IsPlayerCommandLevel(playerid,"giveweapon")) {
new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index),tmp2 = strtok(params,Index),tmp3 = strtok(params,Index);
if(!strlen(tmp)||!strlen(tmp2)||!strlen(tmp3)||!IsNumeric(tmp3)||!(strval(tmp3) <= 0 || strval(tmp3) <= 10000)) return SendClientMessage(playerid,red,"Syntax Error: \"/GIVEWEAPON <NICK OR ID> <WEAPON NAME | ID> <1-10,000>\".");
new id,id2; if(!IsNumeric(tmp)) id = ReturnPlayerID(tmp); else id = strval(tmp); if(!IsNumeric(tmp2)) id2 = ReturnWeaponID(tmp2); else id2 = strval(tmp2);
if(IsPlayerConnected(id) && id != INVALID_PLAYER_ID) {
if(id2==-1||id2==19||id2==20||id2==21||id2==0||id2==44||id2==45) return SendClientMessage(playerid,red,"ERROR: You have selected an invalid weapon ID.");
SendCommandMessageToAdmins(playerid,"GIVEWEAPON");
new string[256],name[24],ActionName[24],WeaponName[24]; GetPlayerName(playerid,name,24); GetPlayerName(id,ActionName,24); GetWeaponName(id2,WeaponName,24); if(id2 == 18) WeaponName = "Molotov";
if(id != playerid) { format(string,256,"Administrator \"%s\" has given you %d %s.",name,strval(tmp3),WeaponName); SendClientMessage(id,yellow,string); format(string,256,"You have given \"%s\" %d %s.",ActionName,strval(tmp3),WeaponName); SendClientMessage(playerid,yellow,string); }
else { format(string,256,"You have given yourself %d %s.",strval(tmp3),WeaponName); SendClientMessage(playerid,yellow,string); }
return GivePlayerWeapon(id,id2,strval(tmp3));
} else return SendClientMessage(playerid,red,"ERROR: You can not give a disconnected player a weapon.");
} else return SendLevelErrorMessage(playerid,"giveweapon");
}
But this show me this error
Код:
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(667) : warning 203: symbol is never used: "dcmd_giveweapon"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
1 Warning.
So i changed it to
Код:
CMD:give weapon(playerid, params[])
and it's show me this Error
Код:
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(116) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(126) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(127) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(315) : warning 219: local variable "id" shadows a variable at a preceding level
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(385) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(399) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(409) : warning 219: local variable "id" shadows a variable at a preceding level
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(423) : warning 219: local variable "id" shadows a variable at a preceding level
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(439) : warning 219: local variable "id" shadows a variable at a preceding level
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(472) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(486) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(510) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(524) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(544) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(605) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(619) : warning 219: local variable "string" shadows a variable at a preceding level
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(652) : error 001: expected token: "(", but found "-identifier-"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(652) : error 001: expected token: ";", but found "("
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(653) : error 010: invalid function or declaration
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(654) : error 010: invalid function or declaration
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(655) : error 010: invalid function or declaration
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(656) : error 010: invalid function or declaration
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(657) : error 010: invalid function or declaration
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(658) : error 010: invalid function or declaration
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(660) : error 021: symbol already defined: "GetPlayerName"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(661) : error 010: invalid function or declaration
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(662) : error 010: invalid function or declaration
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(663) : error 010: invalid function or declaration
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(664) : error 010: invalid function or declaration
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(665) : error 010: invalid function or declaration
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(667) : warning 203: symbol is never used: "ActionName"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(667) : warning 203: symbol is never used: "Index"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(667) : warning 203: symbol is never used: "WeaponName"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(667) : warning 203: symbol is never used: "id"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(667) : warning 203: symbol is never used: "id2"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(667) : warning 203: symbol is never used: "name"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(667) : warning 203: symbol is never used: "string"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(667) : warning 203: symbol is never used: "tmp"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(667) : warning 203: symbol is never used: "tmp2"
C:\Users\User\Desktop\GangWar\gamemodes\Test.pwn(667) : warning 203: symbol is never used: "tmp3"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
14 Errors.
how Fix