if(strcmp(cmd, "/v", true) == 0)
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp) || strlen(tmp) > 32) { return SendClientMessage(playerid, COLOR, ""RED"Usage:/v [ID/NAME]"); }
new car;
if(!IsNumeric(tmp)) { car = GetVehicleModelIDFromName(tmp); } else { car = strval(tmp); }
if(car > 611 || car < 400) { return SendClientMessage(playerid, COLOR, ""RED"Invalid Vehicle/Name!"); }
if(CreateCar[playerid] != -1) { DestroyVehicle(CreateCar[playerid]); }
new Float:pos[4];
GetPlayerPos(playerid, pos[0], pos[1], pos[2]);
GetPlayerFacingAngle(playerid, pos[3]);
CreateCar[playerid] = CreateVehicle(car, pos[0], pos[1], pos[2], pos[3], -1, -1, 50000);
PutPlayerInVehicle(playerid, CreateCar[playerid], 0);
SetCameraBehindPlayer(playerid);
new MaxPlayers = GetMaxPlayers();
for(new i; i < MaxPlayers; i++)
{
if(!IsPlayerConnected(i) || i == playerid) continue;
SetVehicleParamsForPlayer(CreateCar[playerid], i, 0, true);
}
return 1;
}
return SendClientMessage(playerid, COLOR, ""RED"Type /help to see the commands!");
}
if(strcmp(cmd, "/givecash", true) == 0)
{
new reciever, money;
if (sscanf(cmdtext, "dd", reciever, money)) SendClientMessage(playerid, COLOR, ""RED"Usage: /givecash [playerid] [amount]");
else
{
if(GetPlayerMoney(playerid) < money)
{
SendClientMessage(playerid, COLOR, ""RED"You don't have that much!");
return 1;
}
new string[64], playername[MAX_PLAYER_NAME], playername2[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerName(reciever, playername2, sizeof(playername2));
format(string, sizeof(string), ""GREEN"You recieved &%d from %s.", money, playername);
SendClientMessage(playerid, COLOR, string);
format(string, sizeof(string), ""GREEN"You gave &%d to %s.", money, playername);
SendClientMessage(playerid, COLOR, string);
GivePlayerMoney(playerid, GetPlayerMoney(playerid) - money);
GivePlayerMoney(reciever, GetPlayerMoney(reciever) + money);
return 1;
}
}
|
Here is the command:
I have two commands with zcmd and the other are strcmp.Is this the problem? |
//------------------------------CancelCommand-----------------------------//
CMD:cancel(playerid, params[])
{
if(isindm2[playerid]==1)
isindm2[playerid] = 0;
if(isindm1[playerid]==1)
isindm1[playerid] = 0;
else return SendClientMessage(playerid, COLOR, ""RED"You're not in a Dm!");
SetPlayerPos(playerid, 0.0 ,0.0, 3.0);
new string[128],pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof(string)," "GREEN"%s "RED"exit DM1",pName);
SendClientMessageToAll(COLOR_YELLOW,string);
return 1;
}
if(isindm1[playerid]==1) return SendClientMessage(playerid, COLOR, ""RED"You need to exit the deathmatch first.");
if(isindm2[playerid]==1) return SendClientMessage(playerid, COLOR, ""RED"You need to exit the deathmatch first.");
//-------------------------------Dm1Command-------------------------------//
CMD:dm1(playerid, params[])
{
isindm1[playerid]=1;
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
SetPlayerPos(playerid, 1776.9133, -1801.5455, 52.4688);
SetPlayerFacingAngle(playerid, 0);
SetPlayerVirtualWorld(playerid, 1);
new string[128],pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof(string)," "GREEN"%s "RED"Joined Dm1",pName);
SendClientMessageToAll(COLOR_YELLOW,string);
SendClientMessage(playerid,COLOR_SEAGREEN,"Type /cancel To Leave Dm1!");
return 1;
}
//-------------------------------Dm2Command-------------------------------//
CMD:dm2(playerid, params[])
{
isindm2[playerid]=1;
new rand = random(sizeof(RandomSpawn));
SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
SetPlayerFacingAngle(playerid, RandomSpawn[rand][3]);
new string[128],pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
format(string,sizeof(string)," "GREEN"%s "RED"Joined Dm2",pName);
SendClientMessageToAll(COLOR,string);
SendClientMessage(playerid,COLOR_SEAGREEN,"Type /cancel To Leave Dm2!");
return 1;
}
C:\Documents and Settings\user\Desktop\server samp\gamemodes\testserver.pwn(2054) : error 010: invalid function or declaration C:\Documents and Settings\user\Desktop\server samp\gamemodes\testserver.pwn(2055) : error 010: invalid function or declaration Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase 2 Errors.
|
Just a small off-topic addition: I see you are using color embeddings like this
"RED" - I suppose you have defined them as "#define RED FFFFFF (whatever red is)". In that case you should not use "RED" but "#RED" |