PDA

View Full Version : vehiclerespawn


lsreskjn
26/07/2013, 12:51 PM
if(!strcmp(cmdtext, "/respawncar", true))
{
if(!IsPlayerAdmin(playerid)) return 0;
for(new i = 0; i < MAX_VEHICLES; i++)
{
SetVehicleToRespawn(i);
}
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
SendClientMessageToAll(0x800080FF, "Adminstrátor %s respawol auta na servery", name);
return 1;
}

The error: (990) : warning 202: number of arguments does not match definition

dEcooR
26/07/2013, 12:55 PM
Try this dude

if(!strcmp(cmdtext, "/respawncar", true))
{
if(!IsPlayerAdmin(playerid)) return 0;
for(new i = 0; i < MAX_VEHICLES; i++) SetVehicleToRespawn(i);

new name[MAX_PLAYER_NAME],string[128];
GetPlayerName(playerid, name, sizeof(name));
format(string,128,"Adminstrátor %s respawol auta na servery", name);
SendClientMessageToAll(0x800080FF, string);
return 1;
}

lsreskjn
26/07/2013, 12:57 PM
if(!strcmp(cmdtext, "/respawncar", true))
{
if(!IsPlayerAdmin(playerid)) return 0;
for(new i = 0; i < MAX_VEHICLES; i++)
{
SetVehicleToRespawn(i);
}
new name[MAX_PLAYER_NAME],string[128];
GetPlayerName(playerid, name, sizeof(name));
format(string,128,"Adminstrátor %s respawol auta na servery", name");
SendClientMessageToAll(0x800080FF, string);
return 1;
}

error: :(990) : error 037: invalid string (possibly non-terminated string)
(990) : warning 215: expression has no effect
(990) : error 001: expected token: ";", but found ")"
(990) : error 029: invalid expression, assumed zero
(990) : fatal error 107: too many error messages on one line

kartik
26/07/2013, 01:21 PM
if(!strcmp(cmdtext, "/respawncar", true))
{
if(!IsPlayerAdmin(playerid)) return 0;
for(new i = 0; i < MAX_VEHICLES; i++)
{
SetVehicleToRespawn(i);
}
new name[MAX_PLAYER_NAME],string[128];
GetPlayerName(playerid, name, sizeof(name));
format(string,128,"Adminstrátor %s respawol auta na servery", name");
SendClientMessageToAll(0x800080FF, string);
return 1;
}

error: :(990) : error 037: invalid string (possibly non-terminated string)
(990) : warning 215: expression has no effect
(990) : error 001: expected token: ";", but found ")"
(990) : error 029: invalid expression, assumed zero
(990) : fatal error 107: too many error messages on one line

try this:

public OnPlayerCommandText(playerid, cmdtext[])
{
if(!strcmp(cmdtext, "/respawncar", true))
{
if(!IsPlayerAdmin(playerid)) return 1;
for(new i = 0; i < MAX_VEHICLES; i++)
{
SetVehicleToRespawn(i);
}
new name[MAX_PLAYER_NAME],string[128];
GetPlayerName(playerid, name, sizeof(name));
format(string,128,"Adminstrátor %s respawol auta na servery", name);
return SendClientMessageToAll(0x800080FF, string);

}
return 0;
}

Jessyy
26/07/2013, 01:24 PM
if(!strcmp(cmdtext, "/respawncar", true))
{
if(!IsPlayerAdmin(playerid)) return 0;
for(new i = 0; i < MAX_VEHICLES; i++)
{
SetVehicleToRespawn(i);
}
new name[MAX_PLAYER_NAME],string[128];
GetPlayerName(playerid, name, sizeof(name));
format(string,128,"Adminstrátor %s respawol auta na servery", name");
SendClientMessageToAll(0x800080FF, string);
return 1;
}

error: :(990) : error 037: invalid string (possibly non-terminated string)
(990) : warning 215: expression has no effect
(990) : error 001: expected token: ";", but found ")"
(990) : error 029: invalid expression, assumed zero
(990) : fatal error 107: too many error messages on one line

Let me show you something:
format(string,128,"Adminstrátor %s respawol auta na servery", name"); //remove the ' " '

kartik
26/07/2013, 03:06 PM
Let me show you something:
format(string,128,"Adminstrátor %s respawol auta na servery", name"); //remove the ' " '

Will still show errors ,try and compile it .
Mine is compiling fine but IDK if it works ingame
(don't have GTA:SA right now!)

PrinceKumar
26/07/2013, 03:25 PM
use this format(string, sizeof(string),"your_message", name);
SendClientMessageToAll(-1, string);

Jessyy
26/07/2013, 05:58 PM
Will still show errors ,try and compile it .
Mine is compiling fine but IDK if it works ingame
(don't have GTA:SA right now!)

Pfff... I have putted the code in a blank script... and it works to compile...