Posts: 320
Threads: 51
Joined: Jul 2010
Reputation:
0
Can someone point me towards a carbomb script, or maybe a tutorial?
Specs:
Player needs to have to go somewhere to buy the bomb
Player needs to /detonate and kill whoever is in the car with a big explosion
Player should be able to see who is in the car
Kinda like the system on SACnR (SA Cops & Robbers)
Thanks
-Kevin
Crazy Awesome, Owner
PS I'm a noob at scripting and would appreciate someone helping me out or scriping it for me.
Posts: 192
Threads: 17
Joined: May 2010
Reputation:
0
Tell me if my code worked
Posts: 2,938
Threads: 162
Joined: May 2010
wtf do you people indent with? space?
pawn Код:
public OnPlayerEnterCheckpoint(playerid)//or something else
{
if(HasC4[playerid] == 1)
{
SendClientMessage(playerid,COLOR_RED,"You already own C4");
}
if(GetPlayerMoney(playerid) >= 14999)
{
SendClientMessage(playerid,COLOR_RED,"You Don't have enough cash");
}
HasC4[playerid] =1;
GivePlayerMoney(playerid, -15000);
}
if(!strcmp(cmdtext,"/placeC4",true))
{
if(IsPlayerInAnyVehicle(playerid))
{
new bomb = IsValidObject(1252);
new bomb, Float:x,Float:y,Float:z;
GetPlayerPos(playerid,x,y,z);
CreateObject(bomb,x,y,z+1,0,0,0);
HasC4[playerid] =0;
C4Placed[playerid] =1;
}
}
if(!strcmp(cmdtext,"/detonateC4",true))
{
if(C4Placed[playerid] == 0)
{
SendClientMessage(playerid,COLOR_RED,"You Haven't placed C4");
}
if(C4Placed[playerid] != 0)
new bomb - IsValidObject(1252);
new Float:bx,Float:by,Float:bz;
GetObjectPos(bomb,bx,by,bz);
CreateExplosion(bx,by,bz+1,7,10);
DestroyObject(bomb);
C4Placed[playerid =0);
}
Posts: 2,938
Threads: 162
Joined: May 2010
POST EACH LINE THAT HAS A ERROR ON IT
Posts: 718
Threads: 79
Joined: Aug 2009
Reputation:
0
The errors seem to be coming from the OnPlayerCommandText commands
I tried using this, and when i do "new bomb;" at the top of the script i get an error saying "Bomb is already defined" but if i remove it, "Bomb isn't defined"
Posts: 320
Threads: 51
Joined: Jul 2010
Reputation:
0
i only get these errors when i insert the code u gave me.