16.05.2010, 15:18
_________________________________________________
1st problem.
_________________________________________________
/attempt (command)
It shows "attempt: attempted to (action here) and failed / succeeded"
Should show: "Firstname_Lastname: attempted to (action here) and failed / succeeded"
Code:
_________________________________________________
2nd problem
_________________________________________________
idea: If you are in the government service (service id is 13) (a bodyguard) You go to a certain place and do /locker , which gives you several guns.
Errors:
Line codes:
(4902):
(4904):
(4906):
(4912):
Full code:
Hopefully I will get helped.
1st problem.
_________________________________________________
/attempt (command)
It shows "attempt: attempted to (action here) and failed / succeeded"
Should show: "Firstname_Lastname: attempted to (action here) and failed / succeeded"
Code:
Код:
//-------------------------[Attempt]-------------------------------------------- if(strcmp(cmd, "/attempt", true) == 0) { if(IsPlayerConnected(playerid)) { new length = strlen(cmdtext); while ((idx < length) && (cmdtext[idx] <= ' ')) { idx++; } new offset = idx; new result[64]; while ((idx < length) && ((idx - offset) < (sizeof(result) - 1))) { result[idx - offset] = cmdtext[idx]; idx++; } result[idx - offset] = EOS; if(!strlen(result)) { SendClientMessage(playerid, COLOR_WHITE, "USAGE: /attempt <action>"); return 1; } new succeed = 1 + random(2); if(succeed == 1) { format(string, sizeof(string), "%s: attempted to %s and succeeded", GetPlayerName(playerid, sendername, sizeof(sendername)), result); ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } else if(succeed == 2) { format(string, sizeof(string), "%s: attempted to %s and failed", GetPlayerName(playerid, sendername, sizeof(sendername)), result); ProxDetector(20.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); } } return 1; }
2nd problem
_________________________________________________
idea: If you are in the government service (service id is 13) (a bodyguard) You go to a certain place and do /locker , which gives you several guns.
Errors:
Код:
C:\Documents and Settings\Suns\Desktop\SRPNEW.pwn(4902) : error 010: invalid function or declaration C:\Documents and Settings\Suns\Desktop\SRPNEW.pwn(4904) : error 010: invalid function or declaration C:\Documents and Settings\Suns\Desktop\SRPNEW.pwn(4906) : error 010: invalid function or declaration C:\Documents and Settings\Suns\Desktop\SRPNEW.pwn(4912) : error 021: symbol already defined: "GivePlayerWeapon" Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 4 Errors.
Line codes:
(4902):
Код:
if(strcmp(cmdtext, "/locker", true) == 0)
Код:
if(IsPlayerConnected[playerid])
Код:
if(PlayerInfo[playerid][pService] == 13 && PlayerToPoint(30, playerid, position.here,position.here,position.here))
Код:
GivePlayerWeapon(playerid, 34, 10000);
Код:
if(strcmp(cmdtext, "/locker", true) == 0) { if(IsPlayerConnected[playerid]) { if(PlayerInfo[playerid][pService] == 13 && PlayerToPoint(30, playerid, position.here,position.here,position.here)) { GetPlayerName(playerid, sendername, sizeof(sendername)); format(string, sizeof(string), "* %s takes duty guns from his locker.", sendername); ProxDetector(10.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE); GivePlayerWeapon(playerid, 34, 10000); GivePlayerWeapon(playerid, 29, 10000); GivePlayerWeapon(playerid, 27, 10000); GivePlayerWeapon(playerid, 23, 10000); GivePlayerWeapon(playerid, 41, 10000); GivePlayerWeapon(playerid, 1, 1); SetPlayerArmour(playerid, 100); tazer[playerid] = 2; SendClientMessage(playerid,COLOR_PURPLE,"You are now [ON] duty as a Body Guard."); }
Hopefully I will get helped.