03.04.2010, 22:28
Well, I got the code in my script, but i get errors when trying to compile it.
The code.
The Error.
The code.
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp(cmdtext, "/help", true) == 0)
{
SendClientMessage(playerid, COLOR_BLUE, "++++++++++++++++++++++HELP MENU++++++++++++++++++++++");
SendClientMessage(playerid, COLOR_RED, "Player Commands /pcmds");
SendClientMessage(playerid, COLOR_RED, "General Commands /gcmds");
SendClientMessage(playerid, COLOR_RED, "Objective /jobs");
SendClientMessage(playerid, COLOR_RED, "Vehicles & Weapons /vw");
SendClientMessage(playerid, COLOR_RED, "Administrator Commands /acmds");
return 1;
}
if(strcmp(cmdtext, "/suicide", true) == 0)
{ SetPlayerHealth(playerid, 0);
SendClientMessage(playerid, COLOR_RED, "You have commited suicide.");
return 1;
}
if(strcmp(cmdtext, "/pcmds", true) == 0)
{ SendClientMessage(playerid, COLOR_BLUE, "++++++++++++++++++++++Player Commands++++++++++++++++++++++");
SendClientMessage(playerid, COLOR_RED, "/suicide - Kill yourself.");
return 1;
}
if(strcmp(cmdtext, "/gcmds", true) == 0)
{ SendClientMessage(playerid, COLOR_BLUE, "++++++++++++++++++++++General Commands++++++++++++++++++++++");
SendClientMessage(playerid, COLOR_RED, "/stats - shows you your current stats.");
return 1;
}
if(strcmp(cmdtext, "/stats", true) == 0)
{ SendClientMessage(playerid, COLOR_BLUE, "++++++++++++++++++++++Stats++++++++++++++++++++++");
SendClientMessage(playerid, COLOR_RED, "-Name-");
new name[MAX_PLAYER_NAME], string[48];
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "%s ", name );
SendClientMessage(playerid, COLOR_WHITE, string);
SendClientMessage(playerid, COLOR_RED, "-Money-");
format(string, sizeof(string), "You Have $%i.", GetPlayerMoney(playerid));
SendClientMessage(playerid, COLOR_WHITE, string);
return 1;
}
dcmd_ptele1(playerid,params[])
{
new pid;
if(IsPlayerAdmin(playerid));
else if(params,"u",pid)) return SendClientMessage(playerid,COLOUR_RED,"Usage: /ptele1 [ID]");
else if(pid == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOUR_RED,"Inactive player id");
else
{
new name[MAX_PLAYER_NAME],string[128];
GetPlayerName(pid,name,sizeof(name));
format(string,sizeof(string),"%s has been sent to Jail 1!",name);
SendClientMessageToAll(COLOUR_RED,string);
SetPlayerPos(playerid,2652.8525,2732.3157,10.8203);
return 1;
}
}
if(strcmp(cmdtext, "/vw", true) == 0)
{
if(IsPlayerAdmin(playerid)) SendClientMessage(playerid, COLOR_WHITE, "Vehicle Spawned!");
else SendClientMessage(playerid, COLOR_RED, "You must be logged into RCON to use this command.");
return 1;
}
return 0;
}
pawn Код:
C:\Documents and Settings\Skellyhand\Desktop\gtaserver\gamemodes\Untitled.pwn(216) : error 017: undefined symbol "dcmd_ptele1"
C:\Documents and Settings\Skellyhand\Desktop\gtaserver\gamemodes\Untitled.pwn(219) : error 036: empty statement
C:\Documents and Settings\Skellyhand\Desktop\gtaserver\gamemodes\Untitled.pwn(220) : error 017: undefined symbol "params"
C:\Documents and Settings\Skellyhand\Desktop\gtaserver\gamemodes\Untitled.pwn(220) : error 029: invalid expression, assumed zero
C:\Documents and Settings\Skellyhand\Desktop\gtaserver\gamemodes\Untitled.pwn(220) : warning 215: expression has no effect
C:\Documents and Settings\Skellyhand\Desktop\gtaserver\gamemodes\Untitled.pwn(220) : error 001: expected token: ";", but found "return"
C:\Documents and Settings\Skellyhand\Desktop\gtaserver\gamemodes\Untitled.pwn(220) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
6 Errors.