14.06.2010, 09:34
I have a script like this:
and it results:
I know why it's wrong. I know it's because that i need to index the array. But i don't know how to do it (fix it). Please help
pawn Код:
dcmd_getclass(playerid, params[])
{
if(strlen(params) == 0){
SendClientMessage(playerid, 0x00FF00AA, "|- Usage: /getclass [class] -|");
SendClientMessage(playerid, 0xFF0000AA, "___|- Classes -|___");
SendClientMessage(playerid, 0xFFFF00AA, "Class \"Normal\" (Requirement: Nothing) (Cost: $0) (Extras: Nothing)");
SendClientMessage(playerid, 0xFFFF00AA, "Class \"Pilot\" (Requirement: Kill >= 80 | Kill-Death >= -20) (Cost: $10000) (Extras: Able to spawn Planes [/getplane])");
SendClientMessage(playerid, 0xFFFF00AA, "Class \"Rocket Launcher\" (Requirement: Kill >= 30) (Cost: $2000) (Extras: Get 50 Rocket Launchers every spawn)");
return 1;
}
if(params == "normal"){
SendClientMessage(playerid, 0x00FF00AA, "|- You are now a normal soldier -|");
}
return 1;
}
Код:
X:\XXXXX\XXXXX\XXXXX\XXXXX.pwn(209) : error [ LINE OF if(params == "normal"){ ]: array must be indexed (variable "params")