Cars Command!
#21

Why dont you use ladmins one? You can type the name there as well.
Reply
#22

but I want for all players
Reply
#23

You can easily change that, so that all players can use.

Replace
pawn Код:
if(PlayerInfo[playerid][Level] >= 3) {
with
pawn Код:
if(PlayerInfo[playerid][Level] >= 0) {
Reply
#24

Look This Is my Command

Код:
if (strcmp("/v", cmdtext, true, 10) == 0)
	{
	    if(PlayerInfo[playerid][Level] >= 0) {
	    new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); tmp3 = strtok(params,Index);
	    if(!strlen(tmp)) return SendClientMessage(playerid, red, "USAGE: /car [Modelid/Name] [colour1] [colour2]");
		new car, colour1, colour2, string[128];
   		if(!IsNumeric(tmp)) car = GetVehicleModelIDFromName(tmp); else car = strval(tmp);
		if(car < 400 || car > 611) return  SendClientMessage(playerid, red, "ERROR: Invalid Vehicle Model");
		if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);
		if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);
		if(PlayerInfo[playerid][pCar] != -1 && !IsPlayerAdmin(playerid) ) CarDeleter(PlayerInfo[playerid][pCar]);
		new LVehicleID,Float:X,Float:Y,Float:Z, Float:Angle,int1;	GetPlayerPos(playerid, X,Y,Z);	GetPlayerFacingAngle(playerid,Angle);   int1 = GetPlayerInterior(playerid);
		LVehicleID = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1); LinkVehicleToInterior(LVehicleID,int1);
		PlayerInfo[playerid][pCar] = LVehicleID;
		CMDMessageToAdmins(playerid,"CAR");
		format(string, sizeof(string), "%s spawned a \"%s\" (Model:%d) colour (%d, %d), at %0.2f, %0.2f, %0.2f", pName(playerid), VehicleNames[car-400], car, colour1, colour2, X, Y, Z);
        SaveToFile("CarSpawns",string);
		format(string, sizeof(string), "You have spawned a \"%s\" (Model:%d) colour (%d, %d)", VehicleNames[car-400], car, colour1, colour2);
		return SendClientMessage(playerid,lightblue, string);
		{
And Thos are the errors

Код:
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(219) : warning 219: local variable "pName" shadows a variable at a preceding level
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(225) : error 017: undefined symbol "GetOnLinePlayers"
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(509) : error 017: undefined symbol "PlayerInfo"
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(509) : warning 215: expression has no effect
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(509) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(509) : error 029: invalid expression, assumed zero
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(509) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#25

Can someone tell me how ot fixed it?
Reply
#26

Quote:
Originally Posted by Julian12345
Посмотреть сообщение
You can easily change that, so that all players can use.

Replace
pawn Код:
if(PlayerInfo[playerid][Level] >= 3) {
with
pawn Код:
if(PlayerInfo[playerid][Level] >= 0) {
Here it is.
Reply
#27

It give;s me those errors

Код:
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(219) : warning 219: local variable "pName" shadows a variable at a preceding level
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(225) : error 017: undefined symbol "GetOnLinePlayers"
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(509) : error 017: undefined symbol "PlayerInfo"
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(509) : warning 215: expression has no effect
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(509) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(509) : error 029: invalid expression, assumed zero
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(509) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#28

Can someone help me!!!
Reply
#29

Just use this code, i replaced car with v, its from ladmin

pawn Код:
dcmd_v(playerid,params[]) {
    if(PlayerInfo[playerid][Level] >= 0) {
        new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); tmp3 = strtok(params,Index);
        if(!strlen(tmp)) return SendClientMessage(playerid, red, "USAGE: /v [Modelid/Name] [colour1] [colour2]");
        new car, colour1, colour2, string[128];
        if(!IsNumeric(tmp)) car = GetVehicleModelIDFromName(tmp); else car = strval(tmp);
        if(car < 400 || car > 611) return  SendClientMessage(playerid, red, "ERROR: Invalid Vehicle Model");
        if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);
        if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);
        if(PlayerInfo[playerid][pCar] != -1 && !IsPlayerAdmin(playerid) ) CarDeleter(PlayerInfo[playerid][pCar]);
        new LVehicleID,Float:X,Float:Y,Float:Z, Float:Angle,int1;   GetPlayerPos(playerid, X,Y,Z);  GetPlayerFacingAngle(playerid,Angle);   int1 = GetPlayerInterior(playerid);
        LVehicleID = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1); LinkVehicleToInterior(LVehicleID,int1);
        PlayerInfo[playerid][pCar] = LVehicleID;
        CMDMessageToAdmins(playerid,"V");
        format(string, sizeof(string), "%s spawned a \"%s\" (Model:%d) colour (%d, %d), at %0.2f, %0.2f, %0.2f", pName(playerid), VehicleNames[car-400], car, colour1, colour2, X, Y, Z);
        SaveToFile("CarSpawns",string);
        format(string, sizeof(string), "You have spawned a \"%s\" (Model:%d) colour (%d, %d)", VehicleNames[car-400], car, colour1, colour2);
        return SendClientMessage(playerid,lightblue, string);
    } else return SendClientMessage(playerid,red,"ERROR: You cant use this command");
}
And also you need to declare it:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(v,1,cmdtext);
    return 0;
}
Reply
#30

I get it but i get errors here are they

Код:
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(220) : warning 219: local variable "pName" shadows a variable at a preceding level
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(282) : error 017: undefined symbol "dcmd"
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(284) : error 017: undefined symbol "dcmd_v"
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(285) : error 028: invalid subscript (not an array or too many subscripts): "PlayerInfo"
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(285) : warning 215: expression has no effect
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(285) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(285) : error 029: invalid expression, assumed zero
C:\Documents and Settings\user\Desktop\server samp\gamemodes\Stunt.pwn(285) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
And this is the command

Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[256], idx;
    cmd = strtok(cmdtext, idx);
    dcmd(v,1,cmdtext);
    
	dcmd_v(playerid,params[]) {
        if(PlayerInfo[playerid][Level] >= 0) {
        new tmp[256], tmp2[256], tmp3[256], Index; tmp = strtok(params,Index), tmp2 = strtok(params,Index); tmp3 = strtok(params,Index);
        if(!strlen(tmp)) return SendClientMessage(playerid, red, "USAGE: /v [Modelid/Name] [colour1] [colour2]");
        new car, colour1, colour2, string[128];
        if(!IsNumeric(tmp)) car = GetVehicleModelIDFromName(tmp); else car = strval(tmp);
        if(car < 400 || car > 611) return  SendClientMessage(playerid, red, "ERROR: Invalid Vehicle Model");
        if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);
        if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);
        if(PlayerInfo[playerid][pCar] != -1 && !IsPlayerAdmin(playerid) ) CarDeleter(PlayerInfo[playerid][pCar]);
        new LVehicleID,Float:X,Float:Y,Float:Z, Float:Angle,int1;   GetPlayerPos(playerid, X,Y,Z);  GetPlayerFacingAngle(playerid,Angle);   int1 = GetPlayerInterior(playerid);
        LVehicleID = CreateVehicle(car, X+3,Y,Z, Angle, colour1, colour2, -1); LinkVehicleToInterior(LVehicleID,int1);
        PlayerInfo[playerid][pCar] = LVehicleID;
        CMDMessageToAdmins(playerid,"V");
        format(string, sizeof(string), "%s spawned a \"%s\" (Model:%d) colour (%d, %d), at %0.2f, %0.2f, %0.2f", pName(playerid), VehicleNames[car-400], car, colour1, colour2, X, Y, Z);
        SaveToFile("CarSpawns",string);
        format(string, sizeof(string), "You have spawned a \"%s\" (Model:%d) colour (%d, %d)", VehicleNames[car-400], car, colour1, colour2);
        return SendClientMessage(playerid,lightblue, string);
    } else return SendClientMessage(playerid,red,"ERROR: You cant use this command");
}
	return 0;
}
Reply
#31

Quote:
Originally Posted by IvancheBG
Посмотреть сообщение
But I Have It!!!
GEZUS, download lAdmin, put it into your "filterscripts" line and play! Don't implemend it into your gamemode if you don't know how to!
Reply
#32

I get it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)