Author Topic: I need 2 scripts :)  (Read 5400 times)

0 Members and 1 Guest are viewing this topic.

Offline heton99

  • Street Thug
  • *
  • Posts: 10
    • View Profile
I need 2 scripts :)
« on: February 22, 2010, 11:27:43 am »
Hello. I need 2 scripts:
for spawn vehicle and race

first script  spawn pcj600 :)

two script:
I say !race
scripts says:
5
4
3
2
1
Go Go Go!

(sry for me english is very bad :P)



Offline Ettans

  • VC:MP Beta Tester
  • Wiseguy
  • *
  • Posts: 56
    • View Profile
Re: I need 2 scripts :)
« Reply #1 on: February 22, 2010, 11:57:41 am »
mIRC or PAWN server?

Offline heton99

  • Street Thug
  • *
  • Posts: 10
    • View Profile
Re: I need 2 scripts :)
« Reply #2 on: February 22, 2010, 12:00:12 pm »
pawn

Offline Ettans

  • VC:MP Beta Tester
  • Wiseguy
  • *
  • Posts: 56
    • View Profile
Re: I need 2 scripts :)
« Reply #3 on: February 22, 2010, 12:06:46 pm »
Put this under OnPlayerText callback:

Code: [Select]
if(strcmp(text,"!pcj",true) == 0)
{
    new Float:x,
          Float:y,
          Float:z,
          Float:angle,
          string[64],
          pveh[MAX_PLAYERS] = 0;

    GetPlayerPos(playerid,x,y,z);
    GetPlayerFacingAngle(playerid,angle);

    pveh[playerid] = CreateVehicle(191,x,y,z,angle,-1,-1);
    PutPlayerInVehicle(playerid,pveh[playerid]);
    SendClientMessage(playerid,0xFFFFFFFF,"Spawned a PCJ-600!");
    return 0;
}

In-game type !pcj.

Offline heton99

  • Street Thug
  • *
  • Posts: 10
    • View Profile
Re: I need 2 scripts :)
« Reply #4 on: February 22, 2010, 12:12:52 pm »
i have error compile:
Code: [Select]
D:\Gta Vice City\gamemodes\stunt.pwn(226) : error 017: undefined symbol "text"
D:\Gta Vice City\gamemodes\stunt.pwn(228) : warning 219: local variable "x" shadows a variable at a preceding level
D:\Gta Vice City\gamemodes\stunt.pwn(229) : warning 219: local variable "y" shadows a variable at a preceding level
D:\Gta Vice City\gamemodes\stunt.pwn(230) : warning 219: local variable "z" shadows a variable at a preceding level
D:\Gta Vice City\gamemodes\stunt.pwn(238) : warning 202: number of arguments does not match definition
D:\Gta Vice City\gamemodes\stunt.pwn(242) : warning 204: symbol is assigned a value that is never used: "string"
Pawn compiler 3.0.3367         Copyright (c) 1997-2005, ITB CompuPhase

Offline Ettans

  • VC:MP Beta Tester
  • Wiseguy
  • *
  • Posts: 56
    • View Profile
Re: I need 2 scripts :)
« Reply #5 on: February 22, 2010, 12:16:04 pm »
Do you have x,y and z defined globally? Just rename the text to cmdtext and you can remove the string[64]. Also, what line exactly gives the "warning 202: number of arguments does not match definition" warning?

Offline heton99

  • Street Thug
  • *
  • Posts: 10
    • View Profile
Re: I need 2 scripts :)
« Reply #6 on: February 22, 2010, 12:18:12 pm »
I do not understand you me english very bad :X

Offline Ettans

  • VC:MP Beta Tester
  • Wiseguy
  • *
  • Posts: 56
    • View Profile
Re: I need 2 scripts :)
« Reply #7 on: February 22, 2010, 12:21:04 pm »
Ok, try this:

Code: [Select]
if(strcmp(cmdtext,"!pcj",true) == 0)
{
    new Float:angle;

    GetPlayerPos(playerid,x,y,z);
    GetPlayerFacingAngle(playerid,angle);

    CreateVehicle(191,x,y,z,angle,-1,-1);
    SendClientMessage(playerid,0xFFFFFFFF,"Spawned a PCJ-600!");
    return 0;
}

Offline heton99

  • Street Thug
  • *
  • Posts: 10
    • View Profile
Re: I need 2 scripts :)
« Reply #8 on: February 22, 2010, 12:21:55 pm »
error:
Code: [Select]
D:\Gta Vice City\gamemodes\stunt.pwn(325) : warning 202: number of arguments does not match definition
Pawn compiler 3.0.3367 Copyright (c) 1997-2005, ITB CompuPhase


1 Warning.

LINE 325
CreateVehicle(191,x,y,z,angle,-1,-1);

Offline Ettans

  • VC:MP Beta Tester
  • Wiseguy
  • *
  • Posts: 56
    • View Profile
Re: I need 2 scripts :)
« Reply #9 on: February 22, 2010, 12:25:20 pm »
Not sure what's wrong with it, as the line is ok.

Offline heton99

  • Street Thug
  • *
  • Posts: 10
    • View Profile
Re: I need 2 scripts :)
« Reply #10 on: February 22, 2010, 12:47:54 pm »
:( ok.. who can make 2 script? race
« Last Edit: February 22, 2010, 12:57:57 pm by heton99 »

Offline Boss

  • VC:MP Beta Tester (inactive)
  • Made Man
  • *
  • Posts: 229
  • Boss
    • View Profile
    • TDH Clan Site
Re: I need 2 scripts :)
« Reply #11 on: February 22, 2010, 01:17:11 pm »
Please refer to the following resources to learn Pawn scripting:
http://www.compuphase.com/pawn/pawn.htm#DOWNLOAD_DOCS
http://wiki.sa-mp.com/wiki/Category:Scripting_Documentation
http://tdhclan.ru/wiki/index.php/Scripting

If these don't help and you still can't script in Pawn, please hire a scripter to make scripts for you or post a mode request thread instead of requesting each function separately.
« Last Edit: February 22, 2010, 05:32:29 pm by Boss »