04.10.2012, 16:56
Can Anyone give me a strcmp command of setscore/adscore Pls + Rep
addscore or setscore command for admin only pls!!
addscore or setscore command for admin only pls!!
pawn Код:
|
C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(140) : error 017: undefined symbol "cmd" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(143) : error 017: undefined symbol "tmp" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(143) : error 017: undefined symbol "strtok" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(144) : error 017: undefined symbol "tmp" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(151) : error 017: undefined symbol "ReturnUser" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(152) : error 017: undefined symbol "tmp" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(152) : error 017: undefined symbol "strtok" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(153) : error 017: undefined symbol "tmp" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(154) : error 017: undefined symbol "tmp" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(167) : error 017: undefined symbol "string" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(167) : error 017: undefined symbol "string" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(167) : error 029: invalid expression, assumed zero C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(167) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 13 Errors.
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmd, "/setscore", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "Usage: /setscore [playerid/PartOfName] [Level]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "Usage: /setscore [playerid/PartOfName] [Level]");
return 1;
}
if (IsPlayerAdmin(playerid) == 1)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
SetPlayerScore(para1, level);
format(string, sizeof(string), "[Server] You have set %s 's score to %d .", GetPlayerNameEx(para1),level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "[Server] You have been set %d score by %s.", level,GetPlayerNameEx(playerid));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Your not an administrator.");
}
return 1;
}
return 0;
}
pawn Код:
|
C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(146) : error 017: undefined symbol "cmd" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(149) : error 017: undefined symbol "tmp" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(149) : error 017: undefined symbol "strtok" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(150) : error 017: undefined symbol "tmp" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(152) : error 017: undefined symbol "COLOR_GREY" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(157) : error 017: undefined symbol "ReturnUser" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(158) : error 017: undefined symbol "tmp" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(158) : error 017: undefined symbol "strtok" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(159) : error 017: undefined symbol "tmp" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(160) : error 017: undefined symbol "tmp" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(162) : error 017: undefined symbol "COLOR_GREY" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(173) : error 017: undefined symbol "string" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(173) : error 017: undefined symbol "string" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(173) : error 029: invalid expression, assumed zero C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(173) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 15 Errors.
C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(146) : error 017: undefined symbol "cmd" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(150) : error 017: undefined symbol "strtok" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(150) : error 033: array must be indexed (variable "tmp") C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(159) : error 017: undefined symbol "strtok" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(159) : error 033: array must be indexed (variable "tmp") C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(174) : error 017: undefined symbol "string" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(174) : error 017: undefined symbol "string" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(174) : error 029: invalid expression, assumed zero C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(174) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 9 Errors.
#define FILTERSCRIPT #include <a_samp> // Defines #define COLOR_YELLOW 0xFFFF00AA #define COLOR_RED 0xFF0000AA #pragma tabsize 0 #if defined FILTERSCRIPT public OnFilterScriptInit() { print("\n--------------------------------------"); print("STRCMP Command"); print("--------------------------------------\n"); return 1; } public OnFilterScriptExit() { return 1; } #else main() { print("\n----------------------------------"); print(" STRCMP Command"); print("----------------------------------\n"); } #endif //public OnGameModeInit() //{ // Don't use these lines if it's a filterscript //SetGameModeText("Blank Script"); //AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0); //return 1; //} public OnGameModeExit() { return 1; } public OnPlayerRequestClass(playerid, classid) { SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746); SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746); return 1; } public OnPlayerConnect(playerid) { return 1; } public OnPlayerDisconnect(playerid, reason) { return 1; } public OnPlayerSpawn(playerid) { return 1; } public OnPlayerDeath(playerid, killerid, reason) { return 1; } public OnVehicleSpawn(vehicleid) { return 1; } public OnVehicleDeath(vehicleid, killerid) { return 1; } public OnPlayerText(playerid, text[]) { return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp(cmdtext,"/cc", true , 10) == 0)//--- only use if neccesery { if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFF0000AA,"You can't use this command."); SendClientMessageToAll(COLOR_YELLOW," "); SendClientMessageToAll(COLOR_YELLOW," "); SendClientMessageToAll(COLOR_YELLOW," "); SendClientMessageToAll(COLOR_YELLOW," "); SendClientMessageToAll(COLOR_YELLOW," "); SendClientMessageToAll(COLOR_YELLOW," "); SendClientMessageToAll(COLOR_YELLOW," "); SendClientMessageToAll(COLOR_YELLOW," "); SendClientMessageToAll(COLOR_YELLOW," "); SendClientMessageToAll(COLOR_YELLOW," "); SendClientMessageToAll(COLOR_YELLOW," "); SendClientMessageToAll(COLOR_YELLOW," "); SendClientMessageToAll(COLOR_YELLOW," "); SendClientMessageToAll(COLOR_YELLOW," "); SendClientMessageToAll(COLOR_YELLOW," "); SendClientMessageToAll(COLOR_YELLOW," "); new string[64], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,MAX_PLAYER_NAME); format(string,sizeof string,"Admin %s Has now Cleared The chat!.",pName); SendClientMessageToAll(COLOR_YELLOW,string); return 1; } if(strcmp(cmdtext, "/respawncars", true) == 0) { if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFF0000AA,"You can't use this command."); new vh=CreateVehicle(400,0.0,0.0,0.0,0.0,-1,-1,-1); DestroyVehicle(vh); new p[MAX_VEHICLES]; for(new v = 0; v < vh; v++){ p[v]=0; for(new i = 0; i < GetMaxPlayers(); i++){ if(IsPlayerInVehicle(i,v)) p[v]=1; } if(p[v]==0) SetVehicleToRespawn(v); } new string[64], pName[MAX_PLAYER_NAME]; GetPlayerName(playerid,pName,MAX_PLAYER_NAME); format(string,sizeof string,"Admin %s Has Respawned all Unused Cars!",pName); SendClientMessageToAll(COLOR_YELLOW,string); return 1; } if (strcmp("/playradio", cmdtext, true) == 0) { PlayAudioStreamForPlayer(playerid, "http://k006.kiwi6.com/hotlink/txcwk76rs1/bullets_-_sammy_adams.mp3"); return 1; } if(strcmp(cmd, "/setscore", true) == 0) { new tmp[20], cmd[50]; new para1; tmp = strtok(cmdtext, idx); para1 = strval(tmp); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREY, "Usage: /setscore [playerid] [Level]"); return 1; } new level; tmp = strtok(cmdtext, idx); level = strval(tmp); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GREY, "Usage: /setscore [playerid] [Level]"); return 1; } if (IsPlayerAdmin(playerid) == 1) { if(IsPlayerConnected(para1)) { if(para1 != INVALID_PLAYER_ID) { SetPlayerScore(para1, level); format(string, sizeof(string), "[Server] You have set %s 's score to %d .", GetPlayerNameEx(para1),level); SendClientMessage(playerid, COLOR_LIGHTBLUE, string); format(string, sizeof(string), "[Server] You have been set %d score by %s.", level,GetPlayerNameEx(playerid)); SendClientMessage(para1, COLOR_LIGHTBLUE, string); } }//not connected } else { SendClientMessage(playerid, COLOR_GREY, "Your not an administrator."); } return 1; } return 0;
C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(146) : error 017: undefined symbol "cmd" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(150) : error 017: undefined symbol "strtok" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(150) : error 033: array must be indexed (variable "tmp") C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(159) : error 017: undefined symbol "strtok" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(159) : error 033: array must be indexed (variable "tmp") C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(174) : error 017: undefined symbol "string" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(174) : error 017: undefined symbol "string" C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(174) : error 029: invalid expression, assumed zero C:\Users\GMZeus\Desktop\Cops Robbers Project\filterscripts\strcmp_command.pwn(174) : fatal error 107: too many error messages on one line Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 9 Errors.
#define FILTERSCRIPT
#include <a_samp>
// Defines
#define COLOR_YELLOW 0xFFFF00AA
#define COLOR_RED 0xFF0000AA
#pragma tabsize 0
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print("STRCMP Command");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" STRCMP Command");
print("----------------------------------\n");
}
#endif
//public OnGameModeInit()
//{
// Don't use these lines if it's a filterscript
//SetGameModeText("Blank Script");
//AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
//return 1;
//}
public OnGameModeExit()
{
return 1;
}
public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}
public OnPlayerConnect(playerid)
{
return 1;
}
public OnPlayerDisconnect(playerid, reason)
{
return 1;
}
public OnPlayerSpawn(playerid)
{
return 1;
}
public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}
public OnVehicleSpawn(vehicleid)
{
return 1;
}
public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}
public OnPlayerText(playerid, text[])
{
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp(cmdtext,"/cc", true , 10) == 0)//--- only use if neccesery
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFF0000AA,"You can't use this command.");
SendClientMessageToAll(COLOR_YELLOW," ");
SendClientMessageToAll(COLOR_YELLOW," ");
SendClientMessageToAll(COLOR_YELLOW," ");
SendClientMessageToAll(COLOR_YELLOW," ");
SendClientMessageToAll(COLOR_YELLOW," ");
SendClientMessageToAll(COLOR_YELLOW," ");
SendClientMessageToAll(COLOR_YELLOW," ");
SendClientMessageToAll(COLOR_YELLOW," ");
SendClientMessageToAll(COLOR_YELLOW," ");
SendClientMessageToAll(COLOR_YELLOW," ");
SendClientMessageToAll(COLOR_YELLOW," ");
SendClientMessageToAll(COLOR_YELLOW," ");
SendClientMessageToAll(COLOR_YELLOW," ");
SendClientMessageToAll(COLOR_YELLOW," ");
SendClientMessageToAll(COLOR_YELLOW," ");
SendClientMessageToAll(COLOR_YELLOW," ");
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Admin %s Has now Cleared The chat!.",pName);
SendClientMessageToAll(COLOR_YELLOW,string);
return 1;
}
if(strcmp(cmdtext, "/respawncars", true) == 0)
{
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFF0000AA,"You can't use this command.");
new vh=CreateVehicle(400,0.0,0.0,0.0,0.0,-1,-1,-1);
DestroyVehicle(vh);
new p[MAX_VEHICLES];
for(new v = 0; v < vh; v++)
{
p[v]=0;
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsPlayerInVehicle(i,v)) p[v]=1;
}
if(p[v]==0) SetVehicleToRespawn(v);
}
new string[64], pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof string,"Admin %s Has Respawned all Unused Cars!",pName);
SendClientMessageToAll(COLOR_YELLOW,string);
return 1;
}
if (strcmp("/playradio", cmdtext, true) == 0)
{
PlayAudioStreamForPlayer(playerid, "http://k006.kiwi6.com/hotlink/txcwk76rs1/bullets_-_sammy_adams.mp3");
return 1;
}
if(strcmp(cmd, "/setscore", true) == 0)
{
new tmp[20], cmd[50];
new para1;
tmp = strtok(cmdtext, idx);
para1 = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "Usage: /setscore [playerid] [Level]");
return 1;
}
new level;
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GREY, "Usage: /setscore [playerid] [Level]");
return 1;
}
if (IsPlayerAdmin(playerid) == 1)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
SetPlayerScore(para1, level);
format(string, sizeof(string), "[Server] You have set %s 's score to %d .", GetPlayerNameEx(para1),level);
SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
format(string, sizeof(string), "[Server] You have been set %d score by %s.", level,GetPlayerNameEx(playerid));
SendClientMessage(para1, COLOR_LIGHTBLUE, string);
}
}//not connected
}
else
{
SendClientMessage(playerid, COLOR_GREY, "Your not an administrator.");
}
return 1;
}
return 0;
}