C:\Documents and Settings\Administrator\Desktop\Server\gamemodes\sproba.pwn(234) : error 017: undefined symbol "strtok" C:\Documents and Settings\Administrator\Desktop\Server\gamemodes\sproba.pwn(234) : error 033: array must be indexed (variable "x_nr") Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
x_nr = strtok(cmdtext, idx);
public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/skill", cmdtext, true, 10) == 0) { if(IsSpawned[playerid] == 0) { SendClientMessage(playerid, COLOR_WHITE, "You are dead. You cannot use this command"); return 1; } if(canchooseskill[playerid] == 0) { SendClientMessage(playerid, COLOR_WHITE, "You cannot use this command now. Only certain teams can use this at time of spawn"); return 1; } new x_nr[256]; x_nr = strtok(cmdtext, idx); -----------------------------> ERROR LINE if(!strlen(x_nr)) { SendClientMessage(playerid, COLOR_WHITE,"Use: /skill 1-6 to select your chosen skill. Default skill (Rapist) Will be given if you dont choose"); TextDrawShowForPlayer(playerid,Text:Textdraw0); TextDrawShowForPlayer(playerid,Text:Textdraw1); TextDrawShowForPlayer(playerid,Text:Textdraw2); TextDrawShowForPlayer(playerid,Text:Textdraw3); return 1; } if(strcmp(x_nr,"1",true) == 0) // Weapon Dealivery { SendClientMessage(playerid, COLOR_WHITE,"Type /commands to see your Skill/Job Commands!"); SendClientMessage(playerid,COLOR_WHITE, "Weapon Delivery: Your Job Is To Sell Weapons To Other Players For Earn Money! Type /commands To See Your Commands!"); GivePlayerWeapon(playerid,5,1); GivePlayerWeapon(playerid,22,100); GivePlayerWeapon(playerid,14,1); gTeam[playerid] = TEAM_GUNDEL; SetPlayerToTeamColour(playerid); canchooseskill[playerid] =0; TextDrawHideForPlayer(playerid,Text:Textdraw0); TextDrawHideForPlayer(playerid,Text:Textdraw1); TextDrawHideForPlayer(playerid,Text:Textdraw2); TextDrawHideForPlayer(playerid,Text:Textdraw3); return 1; } else { SendClientMessage(playerid,COLOR_WHITE, "USAGE: /skill 1-6 To Choose Your Skill!"); return 1; } } return 0; }
Originally Posted by Geekzor
if(strcmp("/skill", cmdtext, true, 10) == 0)
{ .. |
Originally Posted by Don Correlli
Quote:
|
Originally Posted by Compton's Eazy E
I dont get it it has 6 characters not 10
|
if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me { .. |
Originally Posted by Don Correlli
Quote:
1 = / 2 = s 3 = k 4 = i 5 = l 6 = l 6 is the length of /skill command. Using_strcmp() Quote:
|
if(strcmp(cmd, "/help", true) == 0)// { SendClientMessage(playerid,COLOR_LIGHTYELLOW2,"Visit us at www.EazyRP.tk"); SendClientMessage(playerid,COLOR_LIGHTYELLOW2,"Commands - /Commands"); SendClientMessage(playerid,COLOR_LIGHTYELLOW2,"Retaketutorial - /Tutorial (not reccommended)"); SendClientMessage(playerid,COLOR_LIGHTYELLOW2,"RP help - /rphelp "); SendClientMessage(playerid,COLOR_LIGHTYELLOW2,"FAQ - /faq "); return 1; }
Originally Posted by Compton's Eazy E
Like this and the script still works
|