how to make command to use one time -
OmarEco - 16.07.2010
now i need make command use one time like fix command
pawn Код:
if(strcmp(cmdtext, "/fix", true) == 0)
{
if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
if(IsPlayerInArea(playerid, 1153.0000, 1307.5000, -2107.5000, -2003.5000) == 1)
{
SendClientMessage(playerid,COLOR_RED,"You are not allowed to repair your vehicle in /BloodringArena.");
}
else
{
SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0);
SendClientMessage(playerid,COLOR_BASIC,"Your vehicle has been fixed.");
SendClientMessage(playerid,COLOR_GREY,"Info: press the -Submission key- to repair your vehicle.");
SendClientMessage(playerid,COLOR_GREY," ( = key to activate smoke on a stuntplane).");
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "(You must be inside a vehicle to use this command).");
}
return 1;
}
oh and how to make flip command to use one time too
[url=https://sampforum.blast.hk/showthread.php?pid=755007#pid755007&posted=1#post755007]join this topic to help me for thing[/url
Re: how to make command to use one time -
Vince - 16.07.2010
pawn Код:
SetPVarInt(playerid, "FixUsed", 1);
if(GetPVarInt(playerid, "FixUsed") == 1) { // you have already used fix! }
Re: how to make command to use one time -
klavins21 - 16.07.2010
pawn Код:
if(strcmp(cmdtext, "/fix", true) == 0)
{
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_RED, "(You must be inside a vehicle to use this command).");
if(IsPlayerInArea(playerid, 1153.0000, 1307.5000, -2107.5000, -2003.5000) == 1) return SendClientMessage(playerid,COLOR_RED,"You are not allowed to repair your vehicle in /BloodringArena.");
if(GetPVarInt(playerid, "FixUsed") == 1) return SendClientMessage(playerid,COLOR_RED,"You have already used fix!");
SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0);
SendClientMessage(playerid,COLOR_BASIC,"Your vehicle has been fixed.");
SendClientMessage(playerid,COLOR_GREY,"Info: press the -Submission key- to repair your vehicle.");
SendClientMessage(playerid,COLOR_GREY," ( = key to activate smoke on a stuntplane).");
PlayerPlaySound(playerid, 1133, 0.0, 0.0, 0.0);
SetPVarInt(playerid, "FixUsed", 1);
return 1;
}
Re: how to make command to use one time -
OmarEco - 17.07.2010
Код:
E:\МнггжП~1\GAMEMO~1\sumo.pwn(255) : error 017: undefined symbol "GetPVarInt"
E:\МнггжП~1\GAMEMO~1\sumo.pwn(260) : error 017: undefined symbol "SetPVarInt"
Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase
2 Errors.
Re: how to make command to use one time -
FrostedVince - 17.07.2010
Use
pawn Код:
SetPVarInt(playerid, "FixUsed") == 1)
instead, worked for my script.
Not sure tough, but give it a try
Re: how to make command to use one time -
OmarEco - 17.07.2010
not work
Re: how to make command to use one time -
Grim_ - 17.07.2010
Download the 0.3a scripting package.
Re: how to make command to use one time -
OmarEco - 17.07.2010
look i have errors
pawn Код:
if(!strcmp(cmdtext, "/repair") || !strcmp(cmdtext, "/r") || !strcmp(cmdtext, "/fix"))
{
SetVehicleHealth(GetPlayerVehicleID(playerid),1000.0);
SendClientMessage(playerid,0xF5260FFF,"You Repair Your Vehicle");
SendClientMessage(playerid,0xF5260FFF,"%s Repair his vehicle (/repair)",PlayerName);
SendClientMessage(playerid,0xF5260FFF,"You Repair Your Vehicle");
SetPVarInt(playerid, "FixUsed", 1);
if(GetPVarInt(playerid, "FixUsed") == 1) return SendClientMessage(playerid,COLOR_RED,"You have already used fix!");
return 1;
}
if(!strcmp(cmdtext, "/flip") || !strcmp(cmdtext, "/f"))
{
if(IsPlayerInAnyVehicle(playerid))
{
new Float:PX, Float:PY, Float:PZ, Float:PA;
GetPlayerPos(playerid, PX, PY, PZ);
GetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
SetVehiclePos(GetPlayerVehicleID(playerid), PX, PY, PZ+1);
SetVehicleZAngle(GetPlayerVehicleID(playerid), PA);
SendClientMessage(playerid,0xF5260FFF,"You flip Your Vehicle");
SendClientMessage(playerid,0xF5260FFF,"%s flip his vehicle (/flip)",PlayerName);
SendClientMessage(playerid,0xF5260FFF,"You flip Your Vehicle");
SetPVarInt(playerid, "FixUsed", 1);
if(GetPVarInt(playerid, "FixUsed") == 1) return SendClientMessage(playerid,COLOR_RED,"You have already used fix!");
}
return 1;
Код:
(255) : error 017: undefined symbol "GetPVarInt"
(260) : error 017: undefined symbol "SetPVarInt"
how i repair this errors
Re: how to make command to use one time -
MenaceX^ - 17.07.2010
Wow...
Read some guides...
You really missed up the code.
Re: how to make command to use one time -
Grim_ - 17.07.2010
Quote:
Originally Posted by Grim_
Download the 0.3a scripting package.
|
Read above.