vehiclerespawn
#1

Код:
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
Reply
#2

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;
}
Reply
#3

Код:
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
Reply
#4

Quote:
Originally Posted by lsreskjn
Посмотреть сообщение
Код:
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:
pawn Код:
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;
}
Reply
#5

Quote:
Originally Posted by lsreskjn
Посмотреть сообщение
Код:
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 ' " '
Reply
#6

Quote:
Originally Posted by Jessyy
Посмотреть сообщение
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!)
Reply
#7

use this
pawn Код:
format(string, sizeof(string),"your_message", name);
SendClientMessageToAll(-1, string);
Reply
#8

Quote:
Originally Posted by kartik
Посмотреть сообщение
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...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)